<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="zhcms.admin.*" %> 
<%@ page import="zhcms.framework.*" %> 
<%@ include file="include/adminhead.jsp" %>
<%
request.setCharacterEncoding("utf-8");
String action=request.getParameter("atcion");
GyUserLoginValidate gycheck=new GyUserLoginValidate();
int ischeck=gycheck.UserLoginValidate(request, response);
if(ischeck==0)
{
		try{
			out.println("<script language='javascript'>alert('对不起！，您还没有登陆');location.href=\"index.jsp\";</script>");
		}
		catch(Exception e){
			e.printStackTrace();
		}
} 

%>
<TABLE width="100%" border=0 align="center" cellPadding=0 cellSpacing=0 class=sortbutton>
	<tr> 
	    <th width="100%" height="22" valign="middle"><a href="?">管理首页</a> </th>
	</tr>
</table>
<br>
<% 
if(action==null || action.length()<=0  || action.equals("main"))
{
String page1=request.getParameter("p");
int pageb;    //存储当前页码
if(page1==null)
   pageb=1;
else 
   pageb=Integer.parseInt(page1);
  
GyReview gyf=new GyReview();

int countnum=gyf.listcount();
%>
<table width="98%" border="0" cellpadding="0" cellspacing="0" align="center" class="TableBorder">
  <tr valign="middle" align="center" height="22"> 
    <th class=sort width="10%">Id</th>
    <th class=sort width="20%">标题</th>
    <th class=sort width="10%">发言人</th>
    <th class=sort width="10%">发表时间</th>
    <th class=sort width="30%">评论内容</th>
    <th class=sort width="20%">操作</th>
  </tr>
<%
if(countnum>0)
{
String lybpages="";
ArrayList<HashMap<String, String>> gytInFor;
gytInFor=new ArrayList<HashMap<String, String>>();
gytInFor=gyf.getAllList(pageb);
lybpages=gyf.getPageStr();
for(int i=0;i<gytInFor.size();i++)
{
	Map<String,String> iAdmininfo=new HashMap<String,String>();
	iAdmininfo =gytInFor.get(i);
 %>
  <tr valign="middle" bgcolor="#FFFFFF" align="center" height="22"> 
    <td>&nbsp;<%=iAdmininfo.get("Id")%></td>
    <td align="left">&nbsp;<%=iAdmininfo.get("Title")%></td>
    <td>&nbsp;<%=iAdmininfo.get("UserName")%></td>
    <td><%=iAdmininfo.get("AddDate")%></td>
    <td><%=iAdmininfo.get("Centent")%></td>
    <td>
    <%
	if(iAdmininfo.get("IsPass").equals("0"))
	{
     %>
    <a href="/zhcms!admin!GyReview(del).do?postid=<%=iAdmininfo.get("Id")%>" onclick="{if(confirm('确定PASS该评论吗?')){return true;}return false;}">通过</a>
    <%
    }
 else
   {
   	%>
    <a href="/zhcms!admin!GyReview(del).do?postid=<%=iAdmininfo.get("Id")%>" onclick="{if(confirm('确定No PASS该评论吗?')){return true;}return false;}">取消</a>
    <%
   } 
     %>
     | <a href="/zhcms!admin!GyReview(del).do?postid=<%=iAdmininfo.get("Id")%>" onclick="{if(confirm('确定删除吗?')){return true;}return false;}">删除</a></td>
  </tr>
<%
}
 %>
  <tr valign="middle" bgcolor="#FFFFFF" align="right">
	<td colspan="6" height="22">&nbsp;<%=lybpages%></td>
  </tr>
 <%
 }
 else
 {
 %> <tr valign="middle" bgcolor="#FFFFFF">
	<td colspan="6" height="22">&nbsp;暂时没有任何信息！</td>
  </tr>
 <%
 } 
 %>
</table>
<%
}
else if(action.equals("add")) 
{

}
%>
<%@ include file="include/adminfoot.jsp" %>

